package com.example.dirviesystem.repository;

import com.example.dirviesystem.entity.SimulateExamRecord;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
import java.util.Optional;

public interface SimulateExamRepository extends JpaRepository<SimulateExamRecord, Long> {
    List<SimulateExamRecord> findByStudentIdAndSubjectAndSubmittedTrue(Long studentId, String subject);
    List<SimulateExamRecord> findByStudentIdAndSubject(Long studentId, String subject);
    Optional<SimulateExamRecord> findTopByStudentIdAndSubjectAndSubmittedFalseOrderByStartTimeDesc(Long studentId, String subject);
}
